<html>
<head><meta charset="utf-8"><title>MarkupKind · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html">MarkupKind</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="201324222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/201324222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Martin Asquino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#201324222">(Jun 18 2020 at 20:49)</a>:</h4>
<p>Hi folks! Quick question, in case this was reported already. I noticed that rust-analyzer does not honour the client's markup kind setting. For example, I have my vim client set to send <code>plaintext</code> as the <code>contentFormat</code> in <code>HoverClientCapabilities</code>, but <code>rust-analyzer</code> sends content with <code>kind</code> markdown.<br>
Is this a known issue or should I open an issue about it?</p>



<a name="201325038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/201325038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#201325038">(Jun 18 2020 at 20:56)</a>:</h4>
<p>You are correct we do not currently look at markdown capabilities. <a href="https://github.com/rust-analyzer/rust-analyzer/issues/4326">https://github.com/rust-analyzer/rust-analyzer/issues/4326</a> is the issue</p>



<a name="201325122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/201325122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#201325122">(Jun 18 2020 at 20:57)</a>:</h4>
<p>Feel free to comment on the issue. PRs are qelcome and we can help you with that!</p>



<a name="201325365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/201325365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Martin Asquino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#201325365">(Jun 18 2020 at 20:59)</a>:</h4>
<p>Ah cool! Thanks for the link! <span aria-label="bow" class="emoji emoji-1f647" role="img" title="bow">:bow:</span></p>



<a name="202199402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/202199402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#202199402">(Jun 27 2020 at 18:43)</a>:</h4>
<p><span class="user-mention" data-user-id="246514">@Martin Asquino</span> can you comment on the issue? I'd like to know how this manifests other than the <code>kind</code> being different. Does your editor not show anything?</p>



<a name="202199916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/202199916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Martin Asquino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#202199916">(Jun 27 2020 at 18:54)</a>:</h4>
<p><span class="user-mention" data-user-id="203366">@Jeremy Kolb</span>  Oh, no, it's just that I prefer the documentation to be plain text, but it does show correctly (formatting aside).</p>
<p>This is how hover looks in my editor (vim) for Rust code:</p>
<p><a href="/user_uploads/4715/XnTh1yQhA4JCLBgu_jytiRw3/image.png">image.png</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/XnTh1yQhA4JCLBgu_jytiRw3/image.png" title="image.png"><img src="/user_uploads/4715/XnTh1yQhA4JCLBgu_jytiRw3/image.png"></a></div><p>And this is how I would prefer it to be shown (this last screenshot is from Go, with gopls):</p>
<p><a href="/user_uploads/4715/mRf0nXBTYIj-K6WZ9rtecA0C/image.png">image.png</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/mRf0nXBTYIj-K6WZ9rtecA0C/image.png" title="image.png"><img src="/user_uploads/4715/mRf0nXBTYIj-K6WZ9rtecA0C/image.png"></a></div><p>It is definitely not a critical issue.</p>



<a name="202201344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/202201344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#202201344">(Jun 27 2020 at 19:27)</a>:</h4>
<p>We are definitely non-compliant here so it should be fixed. Can you switch gopls to use markdown and post a screenshot? I'm curious what the difference is</p>



<a name="202201408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/202201408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#202201408">(Jun 27 2020 at 19:29)</a>:</h4>
<p>It's a weird feature in the LSP. I would expect the client to specify which format it wants but instead it reports which formats it supports in preferential order. I'm not sure if your language client just swaps the order or only send down <code>text</code> as its supported format</p>



<a name="202202083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/202202083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Martin Asquino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#202202083">(Jun 27 2020 at 19:46)</a>:</h4>
<p>Yeah it's definitely weird. The language client I'm using just takes a list of values and sends that to the server, my current config is only <code>['plaintext']</code> though, not sure what the correct behaviour would be for that case, but I'd much rather have it display what it can (I reckon that's what rust-analyzer is doing now) than error if I don't include one of the options or if one of the options is not supported by that specific server.</p>
<p>Here's how gopls display that same bit of code without setting the preferred markup kind for hover or setting <code>['markdown']</code> or <code>['markdown', 'plaintext']</code>.</p>
<p><a href="user_uploads/4715/gxvlnc4qiHi8BSneHgSkoBG3/Untitled.png">Untitled.png</a></p>
<div class="message_inline_image"><a href="user_uploads/4715/gxvlnc4qiHi8BSneHgSkoBG3/Untitled.png" title="Untitled.png"><img src="user_uploads/4715/gxvlnc4qiHi8BSneHgSkoBG3/Untitled.png"></a></div>



<a name="202202245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind/near/202202245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Martin Asquino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/MarkupKind.html#202202245">(Jun 27 2020 at 19:49)</a>:</h4>
<p>(the white block there is just really lazy censoring <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span> )</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>